<template>
  <div class="content" v-loading="loading">
    <button class="add" @click="addProject">新增</button>
    <div class="dashedline"></div>
    <div class="list">
      <div class="header">
        <ul>
          <li>序号</li>
          <li>项目名称</li>
          <li>项目类型</li>
          <li>一级学科</li>
          <li>二级学科</li>
          <li>第一主持人</li>
          <li>所属批次</li>
          <li>状态</li>
          <li>操作</li>
        </ul>
      </div>
      <div class="body">
        <ul v-for="(item, index) in lists" :key="item.id">
          <li>{{ index + 1 }}</li>
          <li>{{ item.name }}</li>
          <li>{{ item.type }}</li>
          <li>{{ item.onediscipline }}</li>
          <li>{{ item.twodiscipline }}</li>
          <li>{{ item.head.name }}</li>
          <li>{{ item.batch }}</li>
          <li>{{ item.state }}</li>
          <li>修改</li>
        </ul>
      </div>
      <div class="page">
        <p>共1页1条记录，当前显示：第 1 页（第 1 到 1 记录 ）</p>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import { useRouter } from 'vue-router'

const router = useRouter()
const loading = ref(false)
const addProject = () => {
  router.push('filling/')
  loading.value = true
  setTimeout(() => {
    loading.value = false
  }, 1000)
}

const lists = ref([
  {
    id: 1,
    name: '创新创业项目管理与学分认定系统',
    type: '创新训练项目',
    onediscipline: '工学',
    twodiscipline: '计算机类',
    head: {
      name: '张三',
      studentID: '2151300123'
    },
    batch: '2024年批次',
    state: '审核中'
  },
  {
    id: 1,
    name: '创新创业项目管理与学分认定系统',
    type: '创新训练项目',
    onediscipline: '工学',
    twodiscipline: '计算机类',
    head: {
      name: '张三',
      studentID: '2151300123'
    },
    batch: '2024年批次',
    state: '审核中'
  }
])
</script>

<style lang="less" scoped>
.content {
  width: 1350px;
  height: 800px;
  background-color: #fff;
  margin: 0 auto;
  margin-top: 40px;
  margin-bottom: 40px;
  .add {
    margin: 20px 40px;
    padding: 10px 10px;
    width: 70px;
    height: 40px;
    background-color: #e9f2fa;
    border: 0;
    color: #36a0fe;
    transition: all 0.1s;
    border-radius: 5px;
    &:hover {
      background-color: #1461cd;
      color: #fff;
    }
  }

  .dashedline {
    width: 100%;
    height: 1px;
    border: 0.5px dashed #ccc;
    margin-bottom: 20px;
  }
  .list {
    ul {
      display: flex;
      justify-content: space-between;
      margin: 0 30px;
      padding: 0 20px;
      height: 50px;
      line-height: 50px;
      // background-color: pink;
      &:hover {
        background-color: #eef1f5;
      }
      li {
        width: 8%;
        // background-color: pink;
        text-align: center;
      }
      li:nth-child(2) {
        width: 20%;
      }
      li:nth-child(8) {
        width: 16%;
      }
    }
    .header {
      ul {
        background-color: #1461cd;
        color: #fff;
        font-size: 14px;
      }
    }
    .body {
      ul {
        font-size: 12px;
      }
    }
  }
  .page {
    height: 50px;
    line-height: 50px;
    font-size: 12px;
    text-align: right;
    margin-right: 30px;
    margin-top: 30px;
  }
}
</style>
